Modify Customer Product
This API is used to update the details of a single product in the system.
The request should contain only elements which require modification. Empty elements denote overriding of the existing value with a NULL value.
|
HTTP URL |
|
|---|---|
| PATCH | /api/v2/customer/{id}/product/{id} |
Eligibility
The Requestor is eligible to request modifications on his own products. It is not eligible to modify any other products.
API Request
Request Structure
|
Parameter |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
description |
String |
O |
Product description |
|
renewalIntervalDay |
Numeric |
O |
Determines the new requested day of the selected period. ENUM Valid values: DAILY: N/A WEEKLY: 1–7 MONTHLY: 1–28 QUARTERLY: 1–90 SEMI_ANNUALLY: 1–180 ANNUALLY: 1–365 ONE_TIME: N/A Can be used only if the product is set with SELF_DEFINED per ‘renewalIntervalMethod’ attribute while creation. Rejected if other ‘renewalIntervalMethod’ ENUM (FIRST_DAY, PRODUCT_ALLOCATION) was selected. |
|
expirationDate |
Date |
O |
Determines the new requested date per the chosen ‘expirationType’ while creation. Can be used only if product ‘expirationType’ is FIXED. Rejected if populated for other expiration types. |
|
expirationUnit |
String |
O |
Determines the new requested time unit that should be used for expiration calculation. ENUM Valid values: DAY, WEEK, MONTH, YEAR Can be used only if selected ‘expirationType’ differs from FIXED. Reject if populated for FIXED ‘expirationType’. |
|
expirationValue |
Numeric |
O |
Determines the new requested time value per chosen ‘expirationUnit’. Can be used only if selected ‘expirationType’ differs from FIXED. Reject if populated for FIXED ‘expirationType’. Consider populating this value if ‘expirationUnit’ has changed. |
API Response
Response Structure
|
Parameter |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
errorCode |
String |
O |
Failure code. See list below, under ‘Error Codes’ section. |
|
errorMessage |
String |
O |
Failure detailed description. See list below, under ‘Error Codes’ section. |
|
content |
Object |
O |
Array of main response body object displayed when an API call was successful. For a failure, it will be empty. |
|
pageable |
Object |
O |
Paging information object displayed when an API call was successful. For a failure, it will be empty. |
Content data objects
|
Element |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
requestId |
UUID |
M |
Request instance ID. To be used by external systems to query the call (operation) status, whether in progress, successful or failed. |
Pageable data objects
|
Element |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
page |
Numeric |
M |
Page number |
|
size |
Numeric |
M |
Page size. Number of requested elements per page |
|
totalPages |
Numeric |
M |
Total amount of available pages per requested page size |
|
totalElements |
Numeric |
M |
Total amount of retrieved elements |
Error Codes
In addition to the general success and failure codes, the following error codes are possible.
|
Code |
Message |
|---|---|
|
GLOBAL_1001 |
Service unavailable. Please try again |
|
CUSTOMER_1002 |
Customer does not exist |
|
CUSTOMER_1045 |
Unknown product id |
Examples
Request Body
{
"expirationUnit": "DAY",
"expirationValue": 5
}
Response Body: Success ACK
{
"errorCode": "",
"errorMessage": "",
"content": [
{
"requestId": "ff74dca6-8e7f-4b85-a42b-13860913b371"
}
],
"pageable": {
"page": 0,
"size": 10,
"totalPages": 1,
"totalElements": 1
}
}
Response Body: Failure NAK
{
"errorCode": "GLOBAL_1001",
"errorMessage": "Service unavailable. Please try again",
"content": "",
"pageable": ""
}